Skip to content

Add unit test to check app.booting flag - #97

Merged
bajtos merged 1 commit into
masterfrom
feature/unit-test-booting-flag
Feb 23, 2015
Merged

Add unit test to check app.booting flag#97
bajtos merged 1 commit into
masterfrom
feature/unit-test-booting-flag

Conversation

@superkhau

Copy link
Copy Markdown
Contributor

Connected to #77

@superkhau

Copy link
Copy Markdown
Contributor Author

@bajtos Review please.

Comment thread test/executor.test.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect(process.bootFlags).to.include('booting')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider learning yourself more familiar with the different assertions provided by Chai, see http://chaijs.com/api/bdd/. The benefit of these assertions (compared to your solution above) is a much more helpful error message reported when the check fails.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. ;) Thanks for the suggestion.

@bajtos bajtos assigned superkhau and unassigned bajtos Feb 19, 2015
@superkhau
superkhau force-pushed the feature/unit-test-booting-flag branch from 51001a1 to 5449fdd Compare February 19, 2015 19:01
@superkhau

Copy link
Copy Markdown
Contributor Author

@bajtos Updated based on code review comments. Good to merge?

@superkhau superkhau assigned bajtos and unassigned superkhau Feb 19, 2015
@superkhau

Copy link
Copy Markdown
Contributor Author

@slnode test please

@bajtos

bajtos commented Feb 20, 2015

Copy link
Copy Markdown
Member

There's one more thing I don't like about the current approach, sorry for realising it too late. By reusing bootFlags, you now have to change other unrelated tests, plus these other tests are now tightly coupled with the order in which the newly added boot script is executed. This will make the maintenance more difficult.

Please rework the test to use different (new) flag, so that you don't have to modify any existing tests in this PR.

@bajtos

bajtos commented Feb 20, 2015

Copy link
Copy Markdown
Member

And also please rebase on top of the current master to pull in the fix for the browserify-related test failures.

@bajtos bajtos assigned superkhau and unassigned bajtos Feb 20, 2015
@superkhau superkhau added #wip and removed #review labels Feb 20, 2015
@superkhau
superkhau force-pushed the feature/unit-test-booting-flag branch from 5449fdd to dba11ed Compare February 20, 2015 21:51
- Ensure `app.booting` is initially `undefined`
- Ensure `app.booting` is set to true during boot execution
- Ensure `app.booting` is set to false upon boot completion
@superkhau
superkhau force-pushed the feature/unit-test-booting-flag branch from dba11ed to e89a60c Compare February 20, 2015 21:52
@superkhau

Copy link
Copy Markdown
Contributor Author

@bajtos Reworked. Review again please.

@superkhau superkhau assigned bajtos and unassigned superkhau Feb 20, 2015
@superkhau

Copy link
Copy Markdown
Contributor Author

@slnode test please

Comment thread test/executor.test.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious, why did you have to change .to.be.false() to .to.not.be.ok()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was by accident actually. I looked up ok() and ...not.be.ok() and true()/false() makes more sense but I forgot to change it back. I will submit another PR to change it back before we forget about it.

@bajtos

bajtos commented Feb 23, 2015

Copy link
Copy Markdown
Member

LGTM.

bajtos added a commit that referenced this pull request Feb 23, 2015
Add unit test to check `app.booting` flag
@bajtos
bajtos merged commit d041d80 into master Feb 23, 2015
@bajtos
bajtos deleted the feature/unit-test-booting-flag branch February 23, 2015 17:01
@bajtos bajtos removed the #wip label Feb 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants